export default (item, res) => {
    if (item.type === "number") {
        var nameMap = {
            day: "今日",
            month: "本月",
            year: "总计",
        };
        let temp = res.data.data;
        let result = [];
        for (var prop in temp) {
            result.push({
                name: nameMap[prop],
                value: parseInt(temp[prop]).toFixed(2),
            });
        }
        item.dynamicData = result
    } else {
        const result = res.data.data.map((item) => {
            return {
                name: item.dates || item.province_name || item.name || item.company_name,
                value: item.send_money || item.rate || item.amount || item.order_volume || item.sales || item.long_lati,
            };
        });
        if(!item.dynamicData) item.staticData = result
        item.dynamicData = result
    }
}